package it.polimi.swKnights.SWIMv2.ejb.entityBeans;

import java.io.Serializable;

public class ReceivedMessagesPK implements Serializable
{
	private int messageID;
	
	private String recipient;
	
	/*
	 * Serial Version ID
	 */
	
	private static final long serialVersionUID = -8830191558459340253L;

	/*
	 * equals and hashCode
	 */
	
	@Override
	public int hashCode()
	{
		final int prime = 31;
		int result = 1;
		result = prime * result + messageID;
		result = prime * result
				+ ((recipient == null) ? 0 : recipient.hashCode());
		return result;
	}

	@Override
	public boolean equals(Object obj)
	{
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		ReceivedMessagesPK other = (ReceivedMessagesPK) obj;
		if (messageID != other.messageID)
			return false;
		if (recipient == null)
		{
			if (other.recipient != null)
				return false;
		}
		else if (!recipient.equals(other.recipient))
			return false;
		return true;
	}
	
	/*
	 * Getters and setters
	 */

	public int getMessageID()
	{
		return messageID;
	}

	public void setMessageID(int messageID)
	{
		this.messageID = messageID;
	}

	public String getRecipient()
	{
		return recipient;
	}

	public void setRecipient(String recipient)
	{
		this.recipient = recipient;
	}

}
